// 类装饰器
const getPositionDecorator: ClassDecorator = (constructor) => {
	constructor.prototype.getPosition = function() {
		return {
			x: 100, 
			y: 200,
			z: 300
		}
	}
};

const bombDecoreator: ClassDecorator = (constructor) => {
	constructor.prototype.boom = function() {
		console.log('爆炸了')
	}
};

// 方法装饰器
const sayDecorator = () => {
	console.log('方法装饰器执行了')
	return (target: any, propKey: string, desc: any) => {

	}
}


@bombDecoreator
@getPositionDecorator
class Tank {}

@bombDecoreator
@getPositionDecorator
class Plane {}

@getPositionDecorator
class Animal {
	// 属性
	name: string = '猫咪'

	// 方法
	@sayDecorator()
	say() {
		console.log(this.name)
	}
}

const t = new Tank()
const p = new Plane()
const a = new Animal()
console.log(Object.getPrototypeOf(p))
console.log(Object.getPrototypeOf(t))
console.log(Object.getPrototypeOf(a))
